Skip to content

chore: Add deps/deps-dev to commit lint rules#330

Open
ayushiahjolia wants to merge 2 commits intomainfrom
lint_update
Open

chore: Add deps/deps-dev to commit lint rules#330
ayushiahjolia wants to merge 2 commits intomainfrom
lint_update

Conversation

@ayushiahjolia
Copy link
Copy Markdown
Contributor

Issue #, if available: N/A

Description of changes: Version bump PRs are failing lint checks because current lint config only allows sdk and examples types. Adding 2 more to fix lint failures - #326

Testing:

ops/ci-checks.sh

And, updated tests.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ayushiahjolia ayushiahjolia changed the title Add deps/deps-dev in lint rules for version upgrade PRs Chore: Add deps/deps-dev in lint rules for version upgrade PRs Mar 26, 2026
@ayushiahjolia ayushiahjolia changed the title Chore: Add deps/deps-dev in lint rules for version upgrade PRs chore: Add deps/deps-dev in lint rules for version upgrade PRs Mar 26, 2026
@ayushiahjolia ayushiahjolia reopened this Mar 26, 2026
@ayushiahjolia ayushiahjolia changed the title chore: Add deps/deps-dev in lint rules for version upgrade PRs chore: Add deps/deps-dev to commit lint rules Mar 26, 2026
@ayushiahjolia ayushiahjolia reopened this Mar 26, 2026
Copy link
Copy Markdown
Contributor

@yaythomas yaythomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could remove lintcommit.js check entirely. It actually just checks the PR (not the commits in the PR). Currently this adds considerable friction and is only relevant to the PR. Also, using js in a python repo is adding churn to PR (in fact, a lot of the failing PR titles are coming from dependabot trying to update nodejs. which is only there to service this)

For a clean commit history, the commit msgs are more important than the PR itself.

I would be interested in maybe instead of this, to amend so it checks the commits that it follows these rules: https://github.com/aws/aws-durable-execution-sdk-python/blob/main/CONTRIBUTING.md#pull-request-title-and-commit-message-format

https://www.conventionalcommits.org/en/v1.0.0/

the most important:

  • Subject line must be 50 characters or less
  • Body text should wrap at 72 characters for good terminal display
  • Use lowercase for type and scope
  • Use imperative mood in subject ("add" not "added" or "adds")
  • No period at the end of the subject line

if len(lines) > 1 and lines[1].strip() != "":
warnings.append("missing blank line between subject and body")

if len(lines) > 2:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

body warning check is skipped entirely if subject + body with no blank line (len(lines) > 1)

when there's no
blank line, the body lines are at index 1+ instead of 2+, so the body length
check uses lines[2:] and misses line index 1.

import sys
import unittest

sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in python the dir name should prob be tests, the dunder means something else in python.


sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))

from lintcommit import validate_message, validate_subject
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldn't need to do this if you import from ops.lintcommit import

return (error, warnings)


def _format_error(title: str, reason: str) -> str:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what calls this? is this dead code?

if subject.endswith("."):
return "subject must not end with a period"

return None
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we enforce lowercase for the entire subject line, pls? strictly speaking not required by conventional commits, but nonetheless, all the examples are like that and it'd be nice to be consistent.

https://www.conventionalcommits.org/en/v1.0.0/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants